<layout name="../Common/Master/master" />
<include file="../Common/Master/left" />
<script src="__PUBLIC__/Home/laydate/laydate.js"></script>
<script src="__PUBLIC__/Home/js/area.js"></script>
<div class="orderright">
<style>
	.ur-ul{
		margin-top: 30px;
		margin-left: 30px;
	}
  .ur-ul li{
	  margin-bottom: 15px;
  }
	.ur-ul li .btn{
		cursor: pointer;
		border:none;
		padding: 5px 5px;
		border-radius: 5px;
		background: darkorange;
	}
	.ur-ul li .btn:hover{
		background: deepskyblue;
		color: #fff;
	}
</style>
<form action="" onsubmit="return edit(this)" method="post">
	<ul class="ur-ul">
		<li>昵称：<input type="text" value="{$userinfo['nickname']}" name="nickname"></li>
		<li>手机号码：<input type="text" value="{$userinfo['phone']}" name="phone"></li>
		<li>联系地址:
			<select name="addres[]" id="area1"></select>
			<select name="addres[]" id="area2"></select>
			<select name="addres[]" id="area3"></select><br/>
			<textarea name="addres[]" style="margin-top: 10px" id="" cols="37" rows="5" placeholder="详细街道">{$userinfo['addres'][3]}</textarea>
		</li>
		<script>
			$(function () {
				area.init('area');
				//选中效果
					area.selected("{$userinfo['addres'][0]}","{$userinfo['addres'][1]}","{$userinfo['addres'][2]}");
			})
		</script>
		<li>生日日期：<input value="{$userinfo['birth']}" placeholder="请输入日期" name="birth" class="laydate-icon" onclick="laydate()"></li>
		<li><button class="btn" type="submit">保存提交</button></li>
	</ul>
</form>
	</div>
<script>
   function edit(that){
      var data=$(that).serialize();
	   $.post("{:U('home/userinfo/store')}",data,function(res){
           if(res.valid){
              location.href="{:U('home/userinfo/info')}";
		   }
		   else{
			   layer.alert(res.msg, {icon: 6});
		   }
	   },'json');
	   return false;
   }
</script>
</div>


